package com.zhoukun.nacos.controller;

import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @author zhoukun 86547462@qq.com
 * @version 1.0
 * @date 2020/10/30 19:20
 */
@RestController
@RefreshScope   //支持nacos的动态刷新功能
public class EchoController {


    @GetMapping(value = "/uuid")
    public String echo() {
        String uuid= UUID.randomUUID().toString();
        return "UUID9001:" + uuid;
    }

    @Value("${info.version}")
    String version;
    @GetMapping(value = "/version")
    public String version() {
        String uuid= UUID.randomUUID().toString();
        return version;
    }
}
